#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void *function(void *pv);
// 读慢，写快，是否逆序？
int main(void) {
	pthread_t _pthread;
	if (pthread_create(&_pthread, NULL, function, "in")) {
		perror("创建线程失败\n");
		exit(EXIT_SUCCESS);
	}
	printf("主线程id = %d\n", gettid());
	printf("分线程标识 %lu\n", _pthread);
	char *return_value;
	pthread_join(_pthread, (void **)&return_value);
	printf("主线程获得返回值：%s\n", return_value);
	return 0;
}
void *function(void *pv) {
	printf("分线程id = %d\n", gettid());
	printf("分线程接收到参数：%s\n", (char *)pv);
	return "out";
}